﻿
//namespace Microsoft.ManagementConsole.SnapIns
//{
//    using System;
//    using System.IO;
//    using System.Text;
//    using System.Collections.Generic;
//    using System.Runtime.Serialization.Formatters.Binary;
//    using Microsoft.ManagementConsole;
//    using Microsoft.ManagementConsole.SnapIns.Integration;

//    [SnapInSettings(MySnapIn.Guid,
//        Vendor = MySnapIn.Vendor,
//        Description = MySnapIn.Description,
//        DisplayName = MySnapIn.DisplayName)]
//    public class MySnapIn : SnapIn
//    {
//        #region Constants
//        #endregion
//        public const string Guid = "{a5345fdd-d497-4884-b200-6da3c3ddbf8b}";
//        public const string DisplayName = "PlanckTime.Mmc";
//        public const string Description = "PlanckTime.Mmc for MMC 3.0";
//        public const string Vendor = "";

//        #region Properties
//        #endregion
//        public List<object> PersistenceData { get; set; }

//        #region Construction
//        #endregion
//        public MySnapIn()
//        {
//            PlanckTimeServices service = new PlanckTimeServices();
//            var user = service.GetUser("system");
//        }

//        #region Events
//        #endregion
//        protected override void OnInitialize()
//        {
//            base.OnInitialize();

//            this.RootNode = new ScopeNode(new Guid(MyScopeNode.Guid), false);
//            this.RootNode.DisplayName = "PlanckTime.Mmc";
//        }
//        protected override bool OnShowInitializationWizard()
//        {
//            return base.OnShowInitializationWizard();
//        }
//        protected override void OnShutdown(AsyncStatus status)
//        {
//            base.OnShutdown(status);
//        }
//        protected override void OnLoadCustomData(AsyncStatus status, byte[] persistenceData)
//        {
//            using (MemoryStream memoryStream = new MemoryStream())
//            {
//                memoryStream.Write(persistenceData, 0, persistenceData.Length);
//                memoryStream.Seek(0, SeekOrigin.Begin);

//                BinaryFormatter binaryFormatter = new BinaryFormatter();

//                this.PersistenceData = (List<object>)binaryFormatter.Deserialize(memoryStream);
//            }
//        }
//        protected override byte[] OnSaveCustomData(SyncStatus status)
//        {
//            if (this.PersistenceData == null)
//            {
//                this.PersistenceData = new List<object>();
//            }

//            using (MemoryStream memoryStream = new MemoryStream())
//            {
//                BinaryFormatter binaryFormatter = new BinaryFormatter();
//                binaryFormatter.Serialize(memoryStream, this.PersistenceData);

//                return memoryStream.ToArray();
//            }
//        }
//    }
//}